package com.projectsexception.festivales.schedule.view;

import android.view.animation.AccelerateInterpolator;
import android.view.animation.Animation;
import android.view.animation.TranslateAnimation;

public class AnimationHelper {

    public static Animation inFromRightAnimation() {
        return createAnimation(+1.0f, 0.0f);
    }

    public static Animation outToLeftAnimation() {
        return createAnimation(0.0f, -1.0f);
    }

    public static Animation inFromLeftAnimation() {
        return createAnimation(-1.0f, 0.0f);
    }

    public static Animation outToRightAnimation() {
        return createAnimation(0.0f, +1.0f);
    }

    private static Animation createAnimation(float fromXValue, float toXValue) {
        Animation outtoRight = new TranslateAnimation(
                Animation.RELATIVE_TO_PARENT, fromXValue,
                Animation.RELATIVE_TO_PARENT, toXValue,
                Animation.RELATIVE_TO_PARENT, 0.0f,
                Animation.RELATIVE_TO_PARENT, 0.0f);
        outtoRight.setDuration(350);
        outtoRight.setInterpolator(new AccelerateInterpolator());
        return outtoRight;
    }

}
